/**
 * Implement Gatsby's Node APIs in this file.
 *
 * See: https://www.gatsbyjs.org/docs/node-apis/
 */

// const docs = require(`./src/utils/node/docs.js`)
// const sections = [docs]
//
// exports.createPages = async helpers => {
//   const { actions } = helpers
//   const { createRedirect } = actions
//   await Promise.all(sections.map(section => section.createPages(helpers)))
// }
//
// exports.onCreateNode = helpers => {
//   sections.forEach(section => section.onCreateNode(helpers))
// }

exports.onCreateWebpackConfig = ({ stage, actions }) => {
  if (stage.startsWith("develop")) {
    actions.setWebpackConfig({
      resolve: {
        alias: {
          "react-dom": "@hot-loader/react-dom"
        }
      }
    });
  }
};
